package cn.wolfcode.luowowo.common.query;

import lombok.Getter;
import lombok.Setter;

@Setter@Getter
public class TravelQueryObject extends QueryObject{
    private Integer state = -1;
    private Long destId = -1L;
    //前台船体过来的类型
    private Integer orderType = 1;
    private Integer travelTimeType = -1;
    private Integer perExpendType = -1;
    private Integer dayType = -1;
    //用户id
    private Long userId;


    //自己提供getter方法来翻译
    public  TravelCondition getTravelTime(){
        return TravelCondition.TRAVEL_TIME.get(travelTimeType);
    }

    public TravelCondition getPerExpend(){
        return TravelCondition.TRAVEL_PER_EXPEND.get(perExpendType);
    }

    public TravelCondition getDay(){
        return TravelCondition.TRAVEL_DAYS.get(dayType);
    }

    public String getOrderBy(){
        return orderType.equals(1) ? "releaseTime desc" : "viewnum desc";
    }

}
